impl Solution {
    pub fn min_difference(mut nums: Vec<i32>) -> i32 {
        if nums.len()<=3{
            return 0;
        }
        nums.sort();
        let mut r=nums.len()-1;
        let mut ans=i32::MAX;
        for i in 0..=3{
            ans=(nums[r+i-3]-nums[i]).min(ans);
        } 
        ans
    }
}